import BossRequest from '@/utils/bosssoft-request'
import request from '@/utils/request'

/**
 * 触发登录校验
 * @param {登录表单} loginQuery
 * @returns token信息
 */
export function login(loginQuery) {
  return BossRequest({
    url: '/api/v1/permission/auth',
    // url: 'auth/token',
    method: 'get',
    params: loginQuery
  })
}

/**
 *  鉴权，解析token信息，获取角色路由表
 * @returns
 */
export function createDynamicRoute() {
  return BossRequest({
    url: '/api/v1/permission/route',
    method: 'get'
  })
}

export function logout() {
  return request({
    url: '/vue-element-admin/user/logout',
    method: 'post'
  })
}
